package com.example.multithread;

public class ThreadSleepTest {
    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                for (int j = 0; j < 100; j ++){
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                    System.out.println("["+ Thread.currentThread().getName() +"] num= " + j);
                }
            }, "Thread-" + i).start();
        }
    }
}
